//
//  CityTableViewCell.m
//  MemoryTravel
//
//  Created by dllo on 15/12/25.
//  Copyright © 2015年 fcx. All rights reserved.
//

#import "CityTableViewCell.h"

@implementation CityTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews{
    self.contentView.backgroundColor = [UIColor colorWithRed:65 / 255.0 green:176 / 255.0 blue:194 / 255.0 alpha:1.0];
    
    UIView *flyware = [UIView new];
    flyware.backgroundColor = [UIColor colorWithRed:200 / 255.0 green:200 / 255.0 blue:200 / 255.0 alpha:1.0];
    [self.contentView addSubview:flyware];
    
    [flyware mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.mas_equalTo(UIEdgeInsetsMake(0, 16, 39, 0));
    }];
    
    self.cityName = [UILabel new];
    self.cityName.font = [UIFont systemFontOfSize:14];
    self.cityName.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.cityName];
    
    [self.cityName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.mas_equalTo(UIEdgeInsetsMake(0, 16, 0, 0));
    }];
}

- (void)setCity:(NSString *)city{
    if (_city != city) {
        _city = city;
    }
    
    self.cityName.text = city;
}

@end
